package com.zm.demo.shoppingmall.gateway;

import cn.hutool.core.text.csv.CsvReadConfig;
import cn.hutool.core.text.csv.CsvReader;
import cn.hutool.core.text.csv.CsvWriter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;

import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.math.BigDecimal;
import java.nio.charset.Charset;
import java.rmi.RemoteException;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author z01140
 * @Package: com.zm.demo.shoppingmall.gateway
 * @Description:
 * @CreateDate 2022/4/28 17:05
 * @UpdateDate 2022/4/28 17:05
 */
@Slf4j
public class ExcelExportDemo11 {


    public static void main(String[] args) throws IOException {

        CsvReader csvReader = new CsvReader(CsvReadConfig.defaultConfig());
        // 此方法必须包含标题
        csvReader.setContainsHeader(false);
        AtomicInteger count = new AtomicInteger();
        AtomicInteger totalRows = new AtomicInteger();
        //插入操作的list
        List<String> target = new ArrayList<>();
        List<String> src = new ArrayList<>();
        List<Map<String, String>> rowsMap = new ArrayList<>();
        //更新操作的list
        List<List<String>> updateRows = new ArrayList<>();
        Map<String, BigDecimal> custPrincipal = new HashMap<>();
        String localFileDir = "D:\\zm\\工作\\07\\法催\\0716";
        try (Reader reader = new FileReader(localFileDir + File.separator + "导出数据订单.txt")){
            csvReader.read(reader, (row) -> {
                target.addAll(row.getRawList());
            });
        }catch (Exception e){
            e.printStackTrace();
        }

        try (Reader reader = new FileReader(localFileDir + File.separator + "源数据订单.txt")){
            csvReader.read(reader, (row) -> {
                src.addAll(row.getRawList());
            });
        }catch (Exception e){
            e.printStackTrace();
        }

        for (String s : src) {
            if (!target.contains(s)){
                System.out.println("未生成订单：" + s);
            }
        }



    }


}
